package com.hyt.model.cloudefile.enums;

import org.apache.commons.lang3.StringUtils;

import lombok.Getter;

/**
 * 文件状态枚举
 * @author huangwu
 */
@Getter
public enum FileStatusEnum {

	
    INIT("0", "初始化"),
    PROCESSING("1", "处理中"),
    SUCCESS("2", "处理成功"),
    FAIL("3", "处理失败"),
	CHECKFAIL("4", "校验失败"),
	CHECKSUCCESS("5", "校验成功"),
    ;
    /**
     * 文件处理状态
     */
    private final String status;
    /**
     * 描述信息
     */
    private final String statusDesc;
    
    
	private FileStatusEnum(String status, String statusDesc) {
		this.status = status;
		this.statusDesc = statusDesc;
	}
	
	
	public static FileStatusEnum getFileStatusEnumByStatus(String status) {
		if(StringUtils.isEmpty(status)) {
			return null;
		}
		for (FileStatusEnum fileStatusEnum : FileStatusEnum.values()) {
			if(fileStatusEnum.getStatus().equals(status)) {
				return fileStatusEnum;
			}
		}
		return null;
	}
    
    
    
	
    
}
